<html>
<head>
	<style type="text/css">
	.odd{
		background-color:#ececec;
	}
	</style>
	<script type="text/javascript">
	var data = {
		seqLong:{
			ie6:[0.078, 0.078, 0.063, 0.078],
			ie7:[0.065, 0.059, 0.058, 0.061],
			firefox:[0.282, 0.309, 0.31, 0.313],
			chrome:[0.171, 0.162, 0.261, 0.181]
		},
		seqShort:{
			ie6:[1.156, 1.155, 1.155, 1.155],
			ie7:[1.155, 1.111, 1.157, 1.22],
			firefox:[0.59, 0.594, 0.569, 0.515],
			chrome:[0.218, 0.21, 0.216, 0.253]
		},
		reLong:{
			ie6:[0.531, 0.499, 0.515, 0.515],
			ie7:[0.486, 0.462, 0.532, 0.487],
			firefox:[1.265, 1.283, 2.87, 1.28],
			chrome:[0.375, 0.477, 0.373, 0.38]
		},
		reShort:{
			ie6:[0.656, 0.687, 0.594, 0.609],
			ie7:[0.494, 0.536, 0.524, 0.522],
			firefox:[1.516, 1.45, 2.939, 1.441],
			chrome:[0.396, 0.392, 0.398, 0.444]
		}
	};
	
	var testNames = {
		seqLong:"Sequentional Mode single long text",
		seqShort:"Sequentional Mode multiple words",
		reLong:"Single regex Mode single long text",
		reShort:"Single regex Mode multiple words"
	};
	
	function getVal(arr){
		if(!arr || arr.length==0)
			return "&nbsp;";
		var res = 0;
		for(var i=0; i<arr.length; i++){
			res+=arr[i];
		}
		res = res/arr.length;
		res = Math.round(res*1000);
		return res+" ms";
	}
	
	function init(){
		var html = ["<table border=\"0\" cellpadding=\"3\" cellspacing=\"0\">"];
		html.push("<th>&nbsp;</th><th>IE 6.0</th><th>IE 7.0</th><th>Mozilla Firefox 3.0</th><th>Google Chrome</th>");
		var idx = 0;
		for(var k in data){var d = data[k]; idx++;
			html.push("<tr");
			if(idx%2)
				html.push(" class=\"odd\"");
			html.push(">");
			html.push("<td>"); html.push(testNames[k]); html.push("</td>");
			
			html.push("<td>"); html.push(getVal(d.ie6)); html.push("</td>");
			html.push("<td>"); html.push(getVal(d.ie7)); html.push("</td>");
			html.push("<td>"); html.push(getVal(d.firefox)); html.push("</td>");
			html.push("<td>"); html.push(getVal(d.chrome)); html.push("</td>");
			
			html.push("</tr>");
		}
		html.push("</table>");
		document.getElementById("out").innerHTML = html.join("");
	}
	</script>
</head>
<body onload="init()">
	<h1>Test results</h1>
	<div id="out"></div>
</body>
</html>